package com.wyz.socket.core.base.packet.string;


import com.wyz.socket.core.base.packet.AbstractByteArrayReceivePacket;

import java.io.ByteArrayOutputStream;

public class StringReceivePacket extends AbstractByteArrayReceivePacket<String> {

    public StringReceivePacket(int length) {
        super(length);
    }

    @Override
    protected String build(ByteArrayOutputStream stream) {
        return new String(stream.toByteArray());
    }

    @Override
    public byte type() {
        return TYPE_MEMORY_STRING ;
    }
}
